#include <stdio.h>

int main(void) {
    // printf("Hello, World!\n");
    int a[10]={10,9,8,7,6,5,4,3,2,1};
    for (int i = 0; i < 10; ++i) {
        printf("%d ",a[i]);
    }
    printf("\n");
    int n=0;
    scanf("%d",&n);
    int left=0;
    int right=9;
    int mid;
    while (left<=right) {
        mid=(right-left)/2+left;
        if(n==a[mid]) {
            printf("已经找到下标%d\n",mid);
            break;
        }else if(n<a[mid]) {
            left=mid+1;
        }else if(n>a[mid]){
            right=mid-1;
        }
    }
    if(right<left) {
        printf("没有该数\n");
    }
    return 0;
}
